/*
 * @Author: 13558093597 277098906@qq.com
 * @Date: 2025-06-13 16:37:28
 * @LastEditors: 13558093597 277098906@qq.com
 * @LastEditTime: 2025-08-19 15:34:46
 * @FilePath: \mes_app\lib\components\home\mine.dart
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:mes_app/color/hex.dart';
import 'package:mes_app/route/index.dart';
import 'package:mes_app/utils/styles.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

///
/// 我的
///
class HomeMineController extends GetxController {}

class HomeMineView extends GetView<HomeMineController> {
  const HomeMineView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: HexColor(HexColor.colorF9f9),
      appBar: TDNavBar(
        title: '我的',
        titleColor: HexColor(HexColor.colorFfff),
        titleFontWeight: FontWeight.w700,
        titleFont: Font(size: StylesUtils.fontSize16.toInt(), lineHeight: 1),
        backgroundColor: HexColor(HexColor.color6190),
        screenAdaptation: true,
        useDefaultBack: false,
        useBorderStyle: true,
        titleMargin: 0,
      ),
      body: SingleChildScrollView(
        child: Column(
          children: [
            SizedBox(
              height: 200,
              child: Stack(
                children: [
                  Container(
                    height: 150,
                    color: HexColor(HexColor.color6190),
                  ),
                  Positioned(
                    left: (Get.width - 355) / 2,
                    right: (Get.width - 355) / 2,
                    top: 20,
                    child: Container(
                      height: 180,
                      decoration: BoxDecoration(
                        color: HexColor(HexColor.colorFfff),
                        borderRadius: BorderRadius.circular(15),
                      ),
                      padding:
                          EdgeInsets.symmetric(horizontal: 15, vertical: 10),
                      child: Column(
                        children: [
                          Row(
                            children: [
                              Expanded(
                                child: Column(
                                  children: [
                                    Align(
                                      alignment: Alignment.centerLeft,
                                      child: TDText(
                                        '小白兔',
                                        style: StylesUtils.customTextStyle(
                                          fontSize: StylesUtils.fontSize18,
                                          fontWeight: FontWeight.w700,
                                          color: HexColor.color3333,
                                        ),
                                      ),
                                    ),
                                    Container(
                                      margin:
                                          EdgeInsets.symmetric(vertical: 10),
                                      alignment: Alignment.centerLeft,
                                      child: TDText(
                                        '生产部门（班组一）',
                                        style: StylesUtils.customTextStyle(
                                          color: HexColor.color9999,
                                        ),
                                      ),
                                    ),
                                    Align(
                                      alignment: Alignment.centerLeft,
                                      child: TDText(
                                        '生产人员',
                                        style: StylesUtils.customTextStyle(
                                          color: HexColor.color9999,
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              TDAvatar(
                                avatarUrl:
                                    'https://img0.baidu.com/it/u=31630240,2165770441&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
                                avatarSize: 90,
                                radius: 0,
                                onTap: () {
                                  Get.toNamed(Routes.mineInfo);
                                },
                              ),
                            ],
                          ),
                          TDDivider(
                            height: 1,
                            margin: EdgeInsets.only(top: 10, bottom: 10),
                            color: HexColor(HexColor.colorE4e4),
                          ),
                          Row(
                            children: [
                              Expanded(
                                child: Column(
                                  children: [
                                    Center(
                                      child: TDText(
                                        '今日报工',
                                        style: StylesUtils.customTextStyle(
                                          fontWeight: FontWeight.w700,
                                          color: HexColor.color3333,
                                        ),
                                      ),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(top: 10),
                                      alignment: Alignment.center,
                                      child: TDText(
                                        '0',
                                        style: StylesUtils.customTextStyle(
                                          fontWeight: FontWeight.w700,
                                          color: HexColor.color6666,
                                          fontSize: StylesUtils.fontSize16,
                                        ),
                                      ),
                                    )
                                  ],
                                ),
                              ),
                              Expanded(
                                child: Column(
                                  children: [
                                    Center(
                                      child: TDText(
                                        '本周报工',
                                        style: StylesUtils.customTextStyle(
                                          fontWeight: FontWeight.w700,
                                          color: HexColor.color3333,
                                        ),
                                      ),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(top: 10),
                                      alignment: Alignment.center,
                                      child: TDText(
                                        '0',
                                        style: StylesUtils.customTextStyle(
                                          fontWeight: FontWeight.w700,
                                          color: HexColor.color6666,
                                          fontSize: StylesUtils.fontSize16,
                                        ),
                                      ),
                                    )
                                  ],
                                ),
                              ),
                              Expanded(
                                child: Column(
                                  children: [
                                    Center(
                                      child: TDText(
                                        '半月报工',
                                        style: StylesUtils.customTextStyle(
                                          fontWeight: FontWeight.w700,
                                          color: HexColor.color3333,
                                        ),
                                      ),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(top: 10),
                                      alignment: Alignment.center,
                                      child: TDText(
                                        '20',
                                        style: StylesUtils.customTextStyle(
                                          fontWeight: FontWeight.w700,
                                          color: HexColor.color6666,
                                          fontSize: StylesUtils.fontSize16,
                                        ),
                                      ),
                                    )
                                  ],
                                ),
                              ),
                              Expanded(
                                child: Column(
                                  children: [
                                    Center(
                                      child: TDText(
                                        '本年报工',
                                        style: StylesUtils.customTextStyle(
                                          fontWeight: FontWeight.w700,
                                          color: HexColor.color3333,
                                        ),
                                      ),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(top: 10),
                                      alignment: Alignment.center,
                                      child: TDText(
                                        '50',
                                        style: StylesUtils.customTextStyle(
                                          fontWeight: FontWeight.w700,
                                          color: HexColor.color6666,
                                          fontSize: StylesUtils.fontSize16,
                                        ),
                                      ),
                                    )
                                  ],
                                ),
                              ),
                            ],
                          )
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            ),
            Container(
              margin: EdgeInsets.only(top: 20),
              color: Colors.white,
              child: TDCellGroup(
                cells: [
                  TDCell(
                    arrow: true,
                    titleWidget: TDText(
                      '关于我们',
                      style: StylesUtils.customTextStyle(
                        color: HexColor.color3333,
                      ),
                    ),
                    imageWidget: SvgPicture.network(
                      'https://cdn8.axureshop.com/demo2023/2215319/images/%E6%88%91%E7%9A%84/u20883.svg',
                      width: 20,
                      height: 20,
                      fit: BoxFit.fill,
                    ),
                  ),
                  TDCell(
                    arrow: true,
                    bordered: false,
                    titleWidget: TDText(
                      '清空缓存',
                      style: StylesUtils.customTextStyle(
                        color: HexColor.color3333,
                      ),
                    ),
                    imageWidget: SvgPicture.network(
                      'https://cdn8.axureshop.com/demo2023/2215319/images/%E6%88%91%E7%9A%84/u20889.svg',
                      width: 20,
                      height: 20,
                      fit: BoxFit.fill,
                    ),
                  )
                ],
              ),
            )
          ],
        ),
      ),
      bottomNavigationBar: Container(
        height: 80,
        padding: EdgeInsets.symmetric(vertical: 15),
        child: Center(
          child: TDButton(
            width: 300,
            height: 50,
            text: '退出登录',
            type: TDButtonType.fill,
            shape: TDButtonShape.rectangle,
            theme: TDButtonTheme.primary,
          ),
        ),
      ),
    );
  }
}
